<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
use Phalcon\Logger\Adapter\File as FileAdapter;
class hilog {
    static function  log(){
        static $log = null;
        if(!$log){
            $config = include APP_PATH . '/app/config/config.php';
            $log = new FileAdapter($config['application']['logsDir'].date('Y-m-d-H').".log");
        }
        return $log;
    }

    static function debug($s) {
        global $_SN_;
        hilog::log()->log(common::trim($s) . "   [SN:$_SN_]", \Phalcon\Logger::DEBUG);
    }

    static function info($s) {
        global $_SN_;
        hilog::log()->log(common::trim($s) . "   [SN:$_SN_]", \Phalcon\Logger::INFO);
    }

    static function error($s) {
        global $_SN_;
        hilog::log()->log(common::trim($s) . "   [SN:$_SN_]", \Phalcon\Logger::ERROR);
    }

}
